const nodemailer = require("nodemailer");

let transporter = nodemailer.createTransport({
  // host:'smtp.ethereal.email',
  service: "qq",
  port: 465, //smtp端口
  secureConnection: true,
  auth: {
    user: "1298630961@qq.com",
    //这里是smtp授权码
    pass: "zdhigdfgdf",
  },
});

function sendMail(message) {
  let mailOptions = {
    from: '"1298630961" <1298630961@qq.com>', //发送地址
    to: "1298630961@qq.com", //接收者
    subject: "部署通知", //主题
    html: message, //内容主体
  };

  transporter.sendMail(mailOptions, (error, info) => {
    if (error) {
      return console.log(error);
    }
    console.log("message send:%s", info.messageId);
  });
}
module.exports = sendMail;
